package com.sunwayworld.basemodule.business.qualitycontrol.qualitycontrolresult.bean;

import com.sunwayworld.framework.data.annotation.Id;
import com.sunwayworld.framework.data.annotation.NotNull;
import com.sunwayworld.framework.data.annotation.Table;
import com.sunwayworld.framework.data.annotation.Transient;
import com.sunwayworld.framework.support.domain.Persistable;
import com.sunwayworld.framework.support.domain.AbstractPersistable;

import java.time.LocalDateTime;

import org.springframework.format.annotation.DateTimeFormat;
import com.alibaba.fastjson.annotation.JSONField;

/**
 * 质控结果数据表
 *
 * @author zhoujq@sunwayworld.com
 * @date 2022-04-13
 */
@Table("T_LIMS_QUALITYCONTROL_TEST_RESULT")
public class LimsQualitycontrolTestResultBean extends AbstractPersistable<Long> implements Persistable<Long>, Comparable {

    @Transient
    private static final long serialVersionUID = -82566196618711043L;

    @Id
    private Long id;// 主键
    private String controlMaterialName;// 质控物名称
    private String mainBatchCode;// 质控物批号
    private String controlMaterialLevel;// 质控物水平
    private String equipmentName;// 仪器设备
    private String professionalGroup;// 专业组
    private String productCode;// 质控项目编码
    private String productName;// 质控项目名称
    private String methodDesc;// 检测方法
    private Double testResult;// 检测结果
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime resultSaveTime;// 录入时间
    private Double targetValue;// 靶值
    private Double standardDeviation;// 标准差
    private Double cvValue;// CV
    private String controlRule;// 质控规则
    private Long controlPlanId;// 质控计划id
    private Long controlProjectId;// 质控计划项目id
    private Long controlTestBatchId;// 质控实验批次id
    private String qualityControlTestBatchCode;// 质控实验批号

    @NotNull(defaultValue = "0")
    private String status;// 质控批次提交状态，与质控批次提交状态同步

    private String removeStatus;// 质控结果查看-剔除状态  默认0  为1时剔除出质控图的绘制

    private String createdByName;// 创建人
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;// 创建时间
    private String createdById;// 制单人编码
    private String createdByOrgId;// 制单人单位编码
    private String createdByOrgName;// 制单人单位名称
    private String identifyCode;// 质控物识别码

    private String submitById;// 制单人编码
    private String submitByName;// 创建人
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime submitTime;// 创建时间

    public String getSubmitById() {
        return submitById;
    }

    public void setSubmitById(String submitById) {
        this.submitById = submitById;
    }

    public String getSubmitByName() {
        return submitByName;
    }

    public void setSubmitByName(String submitByName) {
        this.submitByName = submitByName;
    }

    public LocalDateTime getSubmitTime() {
        return submitTime;
    }

    public void setSubmitTime(LocalDateTime submitTime) {
        this.submitTime = submitTime;
    }

    public String getIdentifyCode() {
        return identifyCode;
    }

    public void setIdentifyCode(String identifyCode) {
        this.identifyCode = identifyCode;
    }

    public String getCreatedByName() {
        return createdByName;
    }

    public void setCreatedByName(String createdByName) {
        this.createdByName = createdByName;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getCreatedById() {
        return createdById;
    }

    public void setCreatedById(String createdById) {
        this.createdById = createdById;
    }

    public String getCreatedByOrgId() {
        return createdByOrgId;
    }

    public void setCreatedByOrgId(String createdByOrgId) {
        this.createdByOrgId = createdByOrgId;
    }

    public String getCreatedByOrgName() {
        return createdByOrgName;
    }

    public void setCreatedByOrgName(String createdByOrgName) {
        this.createdByOrgName = createdByOrgName;
    }

    public String getRemoveStatus() {
        return removeStatus;
    }

    public void setRemoveStatus(String removeStatus) {
        this.removeStatus = removeStatus;
    }

    public Double getTargetValue() {
        return targetValue;
    }

    public void setTargetValue(Double targetValue) {
        this.targetValue = targetValue;
    }

    public Double getStandardDeviation() {
        return standardDeviation;
    }

    public void setStandardDeviation(Double standardDeviation) {
        this.standardDeviation = standardDeviation;
    }

    public Double getCvValue() {
        return cvValue;
    }

    public void setCvValue(Double cvValue) {
        this.cvValue = cvValue;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getControlMaterialName() {
        return controlMaterialName;
    }

    public void setControlMaterialName(String controlMaterialName) {
        this.controlMaterialName = controlMaterialName;
    }

    public String getMainBatchCode() {
        return mainBatchCode;
    }

    public void setMainBatchCode(String mainBatchCode) {
        this.mainBatchCode = mainBatchCode;
    }

    public String getControlMaterialLevel() {
        return controlMaterialLevel;
    }

    public void setControlMaterialLevel(String controlMaterialLevel) {
        this.controlMaterialLevel = controlMaterialLevel;
    }

    public String getEquipmentName() {
        return equipmentName;
    }

    public void setEquipmentName(String equipmentName) {
        this.equipmentName = equipmentName;
    }

    public String getProfessionalGroup() {
        return professionalGroup;
    }

    public void setProfessionalGroup(String professionalGroup) {
        this.professionalGroup = professionalGroup;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getMethodDesc() {
        return methodDesc;
    }

    public void setMethodDesc(String methodDesc) {
        this.methodDesc = methodDesc;
    }

    public Double getTestResult() {
        return testResult;
    }

    public void setTestResult(Double testResult) {
        this.testResult = testResult;
    }

    public LocalDateTime getResultSaveTime() {
        return resultSaveTime;
    }

    public void setResultSaveTime(LocalDateTime resultSaveTime) {
        this.resultSaveTime = resultSaveTime;
    }

    public String getControlRule() {
        return controlRule;
    }

    public void setControlRule(String controlRule) {
        this.controlRule = controlRule;
    }

    public Long getControlPlanId() {
        return controlPlanId;
    }

    public void setControlPlanId(Long controlPlanId) {
        this.controlPlanId = controlPlanId;
    }

    public Long getControlProjectId() {
        return controlProjectId;
    }

    public void setControlProjectId(Long controlProjectId) {
        this.controlProjectId = controlProjectId;
    }

    public Long getControlTestBatchId() {
        return controlTestBatchId;
    }

    public void setControlTestBatchId(Long controlTestBatchId) {
        this.controlTestBatchId = controlTestBatchId;
    }

    public String getQualityControlTestBatchCode() {
        return qualityControlTestBatchCode;
    }

    public void setQualityControlTestBatchCode(String qualityControlTestBatchCode) {
        this.qualityControlTestBatchCode = qualityControlTestBatchCode;
    }

    @Override
    public int compareTo(Object o) {
        if (o.getClass() == LimsQualitycontrolTestResultBean.class) {
            return this.getResultSaveTime().compareTo(((LimsQualitycontrolTestResultBean) o).getResultSaveTime());
        }
        return 0;
    }
}
